package com.sugar.psych.assessment.module.business.dal.mysql.userleavemessageliked;

import java.util.*;

import com.sugar.psych.assessment.framework.common.pojo.PageResult;
import com.sugar.psych.assessment.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.psych.assessment.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.psych.assessment.module.business.dal.dataobject.userleavemessageliked.UserLeaveMessageLikedDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.psych.assessment.module.business.controller.admin.userleavemessageliked.vo.*;

/**
 * 用户留言点赞 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface UserLeaveMessageLikedMapper extends BaseMapperX<UserLeaveMessageLikedDO> {

    default PageResult<UserLeaveMessageLikedDO> selectPage(UserLeaveMessageLikedPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserLeaveMessageLikedDO>()
                .eqIfPresent(UserLeaveMessageLikedDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserLeaveMessageLikedDO::getLeaveMessageId, reqVO.getLeaveMessageId())
                .betweenIfPresent(UserLeaveMessageLikedDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserLeaveMessageLikedDO::getId));
    }

}